package com.wwtech.epp.ui.activity.friend.module;

import com.wwtech.epp.contain.ContainValue;
import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.friend.AddGroupActivity;
import com.wwtech.epp.ui.activity.friend.contract.AddGroupContract;
import com.wwtech.epp.ui.activity.friend.presenter.AddGroupPresenter;
import com.wwtech.epp.ui.adapter.main.ContactAdapter;
import com.wwtech.epp.ui.adapter.main.ContactAddFriendAdapter;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.friend
 * @Description: The moduele of AddGroupActivity, provide field for AddGroupActivity
 * @date 2017/09/12 13:04:59
 */
@Module
public class AddGroupModule {
    private final AddGroupContract.View mView;


    public AddGroupModule(AddGroupContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public AddGroupPresenter provideAddGroupPresenter(HttpAPIWrapper httpAPIWrapper, AddGroupActivity mActivity) {
        return new AddGroupPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public AddGroupActivity provideAddGroupActivity() {
        return (AddGroupActivity) mView;
    }

    @Provides
    @ActivityScope
    public ContactAdapter provideContactAdapter() {
        return new ContactAdapter(ContainValue.userList);
    }
    @Provides
    @ActivityScope
    public ContactAddFriendAdapter provideContactAddFriendAdapter() {
        return new ContactAddFriendAdapter(ContainValue.userList);
    }

}